package com.cq.hd.merchant.controller;

import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.SmsApi;
import com.cq.hd.member.api.dto.SmsDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sms")
@Api(tags = "短信相关接口")
public class SmsController {

    @Autowired
    private SmsApi smsApi;

    @ApiOperation(value = "获取短信验证码")
    @ApiImplicitParam(name = "smsDto", value = "发送短信验证码参数", required = true, paramType = "body", dataType = "SmsDto")
    @ApiResponse(response = String.class, code = 200, message = "接口返回对象参数")
    @PostMapping("/send")
    public Result<Object> sendSms(@RequestBody SmsDto smsDto) {
        return smsApi.sendSms(smsDto);
    }

}
